have a brush with
Have an encounter or come in conflict with, as in
This was not the first time that Bob had a brush with the law
. This expression alludes to the noun
brush
in the sense of “a hostile collision,” a usage dating from about 1400.